<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>dom-修改属性</title>
  </head>
  <body>
    <img src="img/iPhone SE.jpg" alt="" />

    <script>
      document.images[0].onmouseover = function () {
        /* 
          修改元素属性
        */
        this.src = 'img/iphone15.jpg'
      }

      document.images[0].onmouseout = function () {
        /* 
          修改元素属性
        */
        this.src = 'img/iPhone SE.jpg'
      }
    </script>
  </body>
</html>
